<?php
class GroupModel extends Model {
	var $tableName = 'cms_group';
	
	/**
	 * 根据站点id,分组类型（0：栏目分组，1：内容分组）获取分组列表
	 * @param unknown_type $sid 站点id
	 * @param unknown_type $type 类型id
	 */
	public function getGroupList($sid,$type=0){
		$data['siteid'] = $sid;
		$data['type'] = $type;
		//$data['status'] = 1;
		$list = model('Group')->where($data)->select();
		return $list;
	}
	
	/**
	 * 根据站点id,分组类型（0：栏目分组，1：内容分组）获取分组名列表
	 * @param unknown_type $sid 站点id
	 * @param unknown_type $type 类型id
	 */
	public function getGroupNameList($sid,$type=0){
		$data['siteid'] = $sid;
		$data['type'] = $type;
		$data['status'] = 1;
		$list = model('Group')->where($data)->field("name")->select();
		foreach ($list as $k=>$v){
			$list[$k] = $v['name'];
		}
		return $list;
	}
}